package com.android.love.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.android.love.R;

public class ClassAdapter extends BaseAdapter {

	private int[] imgs = { R.drawable.qqny, R.drawable.qqlp, R.drawable.jsyp,
			R.drawable.nyqj, R.drawable.nvyqj, R.drawable.qqyp, R.drawable.qqjj };
	private String[] text_bigs = { "情趣内衣", "计生用品", "男用器具", "女用器具", "情趣用品",
			"情趣家具", "情趣礼品" };
	private String[] text_smalls = { "情趣文胸/情趣丝袜/情趣套装/吊带袜", "避孕套/早孕试纸/排卵试纸/避孕药",
			"自慰杯/充气娃娃/阴臀倒模/仿真乳房", "震动棒/G点后庭/阴蒂刺激/女用穿戴", "润滑剂/情趣跳蛋/延时套环/另类玩具",
			"性爱椅子/性爱沙发", "情趣拼图/性爱礼品" };
	private Context context;

	public ClassAdapter(Context context) {
		super();
		this.context = context;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return imgs.length;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = View.inflate(context, R.layout.class_item, null);
		}
		ImageView iv_calss_item = (ImageView) convertView
				.findViewById(R.id.iv_calss_item);
		TextView tv_class_big = (TextView) convertView
				.findViewById(R.id.tv_class_big);
		TextView tv_class_small = (TextView) convertView
				.findViewById(R.id.tv_class_small);
		iv_calss_item.setImageResource(imgs[position]);
		tv_class_big.setText(text_bigs[position]);
		tv_class_small.setText(text_smalls[position]);
		return convertView;
	}

}
